import { App } from "vue"
import { createRouter, createWebHistory } from "vue-router"
import { staticRouter } from "./static-routes"
import { createRouterGuards } from "./guards"

const router = createRouter({
    history: createWebHistory(),
    routes: staticRouter,
    strict: true,
    scrollBehavior: () => ({ left: 0, top: 0 })
})

export function setupRouter(app: App) {
    app.use(router)
    // 创建路由守卫
    createRouterGuards(router)
}

export default router
